//
//  LeiContentDetailIntroduceViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/19.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "LeiContentDetailIntroduceViewController.h"

@interface LeiContentDetailIntroduceViewController ()

@property (nonatomic, strong) UIScrollView *backGroundView; // 背景

@end

@implementation LeiContentDetailIntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // navi的修改
    [self changeNavigation];
    // 布局
    [self addMySubview];
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    
    // 左边
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    UIBarButtonItem *leftFirstItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    
    UILabel *productPackageNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
    productPackageNameLabel.text = self.leiName;
    productPackageNameLabel.textColor = [UIColor whiteColor];
    productPackageNameLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    productPackageNameLabel.textAlignment = NSTextAlignmentLeft;
    UIBarButtonItem *leftSecondItem = [[UIBarButtonItem alloc] initWithCustomView:productPackageNameLabel];
    self.navigationItem.leftBarButtonItems = @[leftFirstItem, leftSecondItem];
    
    
    
   
    
    
}

#pragma mark - 返回
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 布局
- (void)addMySubview
{
    self.backGroundView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    self.backGroundView.backgroundColor = [UIColor whiteColor];
    self.backGroundView.bounces = NO;
    self.backGroundView.contentSize = CGSizeMake(kScreenWidth, kScreenHeight + 10 * kAdjustParamater);
    [self.view addSubview:_backGroundView];
    
    UILabel *detailContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 25 * kAdjustParamater, 345 * kAdjustParamater, 100 * kAdjustParamater)];
  //  detailContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    if (self.detailString.length == 0) {
        detailContentLabel.text = @"";
    } else {
        detailContentLabel.text = self.detailString;
    }
    detailContentLabel.textColor = [UIColor blackColor];
    detailContentLabel.font = [UIFont systemFontOfSize:k17Big];
    detailContentLabel.numberOfLines = 0;
    // 设置行间距
    [detailContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:detailContentLabel.text lineHeight:6 QianJieGeDaXie:self.qianJieGeZiDaXie]];
    [detailContentLabel sizeToFit];
    [self.backGroundView addSubview:detailContentLabel];
    
//    // 中国主要城市
//    UILabel *chinaZhuYaoCityLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, detailContentLabel.bottom + 15 * kAdjustParamater, kScreenWidth, 15 * kAdjustParamater)];
//   // chinaZhuYaoCityLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    chinaZhuYaoCityLabel.text = @"中国城市主要疾病主要死因构成比";
//    chinaZhuYaoCityLabel.textAlignment = NSTextAlignmentCenter;
//    chinaZhuYaoCityLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
//    chinaZhuYaoCityLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
//    [self.backGroundView addSubview:chinaZhuYaoCityLabel];
//    
//    // 构成比图
//    UIImageView *gouChengBiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, chinaZhuYaoCityLabel.bottom + 25 * kAdjustParamater, 375 * kAdjustParamater, 200 * kAdjustParamater)];
//    NSString *gouChengBiUrl = [self.gengDuoXinXinUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
//    [gouChengBiImageV sd_setImageWithURL:[NSURL URLWithString:gouChengBiUrl] placeholderImage:[UIImage imageNamed:@""]];
//    gouChengBiImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    [gouChengBiImageV sd_setImageWithURL:[NSURL URLWithString:gouChengBiUrl] placeholderImage:[UIImage imageNamed:@""] options:SDWebImageRetryFailed completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
//        gouChengBiImageV.height = image.size.height / 2;
//        NSLog(@"宽度：%f 高度：%f", image.size.width, image.size.height);
//    }];
//    [self.backGroundView addSubview:gouChengBiImageV];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
